import { Router } from 'express';
import {
  getAllRoles,
  getRoleStats,
  getUsersByRole,
  checkUserPermission,
  compareRoles
} from '../controllers/roleController';

const router = Router();

// GET /api/roles - 获取所有可用角色
router.get('/', getAllRoles);

// GET /api/roles/stats - 获取角色统计信息
router.get('/stats', getRoleStats);

// GET /api/roles/:role/users - 根据角色获取用户列表
router.get('/:role/users', getUsersByRole);

// GET /api/roles/users/:userId/permission - 检查用户权限
router.get('/users/:userId/permission', checkUserPermission);

// GET /api/roles/compare - 比较两个角色
router.get('/compare', compareRoles);

export default router;
